API Documentation
ComboBox.h
1 // ComboBox.h
3 //
5 
6 namespace nkWinUi
7 {
11  class ComboBox : public Component
12  {
13  public :
14 
18  class Entry final
19  {
20  public :
21 
25  Entry () ;
29  ~Entry () ;
30 
31  // Getters
39  void* getAttachedData () const ;
40 
41  // Setters
47  void setLabel (const nkMemory::StringView& label) ;
55  void setAttachedData (void* data) ;
56  } ;
57 
58  public :
59 
67  ComboBox (MainSystem* parentSystem) ;
71  ~ComboBox () ;
72 
73  // Getters
77  std::function<void (ComboBox*)> getSelectionCallback () const ;
88  Entry* getEntryPerData (void* data) const ;
92  virtual Entry* getCurrentSelection () const ;
93 
94  // Setters
100  void setSelectionCallback (std::function<void (ComboBox*)> value) ;
112  void setSelectedEntryPerData (void* data) ;
118  virtual void setSelectedEntry (Entry* selected) ;
119 
120  // Entries
130  virtual Entry* insertEntry (const nkMemory::StringView& label, void* data) ;
137  void setEntryData (const nkMemory::StringView& label, void* newData) ;
143  virtual void* deleteEntry (const nkMemory::StringView& label) ;
147  virtual void clearEntries () ;
148 
152  virtual void exportIntrospection (nkExport::Node* rootNode) override ;
156  virtual void importClassFromTree (nkExport::Node* rootNode) override ;
157  } ;
158 }
nkWinUi::ComboBox::insertEntry
virtual Entry * insertEntry(const nkMemory::StringView &label, void *data)
nkWinUi::ComboBox::getSelectionCallback
std::function< void(ComboBox *)> getSelectionCallback() const
nkWinUi::ComboBox::ComboBox
ComboBox(MainSystem *parentSystem)
nkWinUi::ComboBox::exportIntrospection
virtual void exportIntrospection(nkExport::Node *rootNode) override
nkWinUi::ComboBox::~ComboBox
~ComboBox()
nkWinUi::ComboBox::Entry
Represents an entry within the combo box.
Definition: ComboBox.h:19
nkWinUi::ComboBox::Entry::setLabel
void setLabel(const nkMemory::StringView &label)
nkWinUi::ComboBox::clearEntries
virtual void clearEntries()
nkWinUi::ComboBox::Entry::getAttachedData
void * getAttachedData() const
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::ComboBox::Entry::getLabel
nkMemory::StringView getLabel() const
nkWinUi::ComboBox
A graphical combo box.
Definition: ComboBox.h:12
nkWinUi::ComboBox::setSelectedEntryPerLabel
void setSelectedEntryPerLabel(const nkMemory::StringView &label)
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkWinUi::MainSystem
The main system of the component.
Definition: MainSystem.h:18
nkWinUi::ComboBox::Entry::~Entry
~Entry()
nkWinUi::ComboBox::getEntryPerData
Entry * getEntryPerData(void *data) const
nkWinUi::ComboBox::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkWinUi::ComboBox::Entry::Entry
Entry()
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkWinUi::ComboBox::setSelectedEntry
virtual void setSelectedEntry(Entry *selected)
nkWinUi::ComboBox::deleteEntry
virtual void * deleteEntry(const nkMemory::StringView &label)
nkWinUi::ComboBox::setSelectedEntryPerData
void setSelectedEntryPerData(void *data)
nkWinUi::ComboBox::Entry::setAttachedData
void setAttachedData(void *data)
nkWinUi::ComboBox::setSelectionCallback
void setSelectionCallback(std::function< void(ComboBox *)> value)
nkWinUi::ComboBox::setEntryData
void setEntryData(const nkMemory::StringView &label, void *newData)
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Button.h:7
nkWinUi::ComboBox::getEntryPerLabel
Entry * getEntryPerLabel(const nkMemory::StringView &label) const
nkWinUi::ComboBox::getCurrentSelection
virtual Entry * getCurrentSelection() const